﻿@model EnetaMvc.ApplicationServices.Dto.DynamicMenuDto

@{
    ViewBag.Title = "Dynamic Menu Management";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

<div class="content-txt">
    <h2>Dynamic Menu Management</h2>

    @using (Html.BeginForm()) {
        @Html.ValidationSummary(true)
        <fieldset>
            <legend>Edit Menu Item</legend>

            @Html.HiddenFor(model => model.Id)
            @if (Model.Parent != null) {
                @Html.HiddenFor(model => model.Parent.Id)
            }

            <div class="editor-label">
                @Html.LabelFor(model => model.Name)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Name)
                @Html.ValidationMessageFor(model => model.Name)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Url)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Url)
                @Html.ValidationMessageFor(model => model.Url)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.IsVisible)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.IsVisible)
                @Html.ValidationMessageFor(model => model.IsVisible)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.OrderPosition)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.OrderPosition)
                @Html.ValidationMessageFor(model => model.OrderPosition)
            </div>

            <p>
                <input type="submit" value="Save" />
            </p>
        </fieldset>
    }

    <div>
        @Html.ActionLink("Back to List", "Index")
    </div>
</div>